package com.sinu.simplespringboot.otherConfig;



import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.HandlesTypes;
import java.lang.reflect.Modifier;
import java.util.Set;

/**
 * @author Sinu
 * @Date 2021/7/18
 */
//@HandlesTypes(WebApplicationInitializer.class)
//public class MySpringServletContainerInitializer implements ServletContainerInitializer {
//    public void onStartup(Set<Class<?>> set, ServletContext servletContext) throws ServletException {
//
////        fixme
////        System.out.println("默认 Spring 初始化");
//        for (Class<?> aClass : set) {
//
//            if (!aClass.isInterface() && !Modifier.isAbstract(aClass.getModifiers()) && WebApplicationInitializer.class.isAssignableFrom(aClass)) {
//                try {
//                    ((WebApplicationInitializer) aClass.newInstance()).onStartup(servletContext);
//                } catch (InstantiationException e) {
//                    e.printStackTrace();
//                } catch (IllegalAccessException e) {
//                    e.printStackTrace();
//                }
//            }
//
//
//        }
//
//
////        MyWebApplicationInitializer myWebApplicationInitializer = new MyWebApplicationInitializer();
////        myWebApplicationInitializer.onStartup(servletContext);
//    }
//}
